﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using KM.BUS;
using KM.ENT;

namespace KM.Areas.Admin.Controllers
{
    public class LoaiSanPhamController : Controller
    {
        //
        // GET: /LoaiSanPham/

        public ActionResult Index()
        {
            return View();
        }

       
        public ActionResult dsLoaiSanPham()
        {
            busLoaiSanPham busLSP = new busLoaiSanPham();
            List<entLoaiSanPham> lst = new List<entLoaiSanPham>();
            lst = busLSP.getAll();
            return View(lst);
        }
        public ActionResult edit(int id)
        {
            busLoaiSanPham busLSP = new busLoaiSanPham();
            entLoaiSanPham entLSP = new entLoaiSanPham();
            entLSP = busLSP.getInfo(id);
            return View(entLSP);
        }
        [HttpPost]
        public ActionResult edit(entLoaiSanPham entLSP)
        {
            busLoaiSanPham busLSP = new busLoaiSanPham();
            busLSP.createEdit(entLSP);
            return RedirectToAction("dsLoaiSanPham");
        }

    }
}
